menu: Popup at window coordinates if widget is given
authorTimm Bäder <mail@baedert.org>
Wed, 21 Jun 2017 19:31:08 +0000 (21:31 +0200)
committerMatthias Clasen <mclasen@redhat.com>
Thu, 20 Jul 2017 01:27:14 +0000 (21:27 -0400)
Since widget allocations are now relative to the parent's origin, we
need to pass the window allocation here.

gtk/gtkmenu.c
gtk/gtkwidget.c

index 1ac19c030c725d208f66ce6e7c53f4295aa0a609..368fad71ac5a1b01b03903707be0b792411c0ce3 100644 (file)
@@ -4085,7 +4085,7 @@ gtk_menu_position (GtkMenu  *menu,
   else if (priv->widget)
     {
       rect_window = gtk_widget_get_window (priv->widget);
-      gtk_widget_get_allocation (priv->widget, &rect);
+      gtk_widget_get_window_allocation (priv->widget, &rect);
       text_direction = gtk_widget_get_direction (priv->widget);
     }
   else if (!priv->position_func)
index 55849fb28cf0821b76d1e75082cf25817ea8ffe6..76054b47679a786f24a5a54150415079ea3156f3 100644 (file)
@@ -4927,8 +4927,6 @@ gtk_widget_get_window_allocation (GtkWidget     *widget,
   GtkWidget *parent;
   GtkAllocation alloc;
 
-  g_assert (gtk_widget_get_has_window (widget));
-
   /* Don't consider the parent == widget case here. */
   parent = _gtk_widget_get_parent (widget);
   while (parent && !_gtk_widget_get_has_window (parent))